/* 通用样式 */
.container {
    width: 1190px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* 顶部导航样式 */
.top-bar {
    background-color: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
    height: 35px;
    line-height: 35px;
    font-size: 12px;
    color: #666;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
}

.location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.location i {
    color: #ff6700;
    font-size: 14px;
}

.city {
    color: #ff6700;
    cursor: pointer;
}

.city:hover {
    color: #ff5500;
}

.top-links {
    display: flex;
    gap: 15px;
}

.top-link-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0 5px;
    position: relative;
}

.top-link-item:hover {
    color: #ff6700;
}

.top-link-item i {
    font-size: 14px;
}

/* 分隔线 */
.top-link-item:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 12px;
    background-color: #ddd;
    margin-left: 15px;
    vertical-align: middle;
}

/* 购物车数量提示 */
.top-link-item.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: 2px;
    left: 12px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background-color: #ff6700;
    color: #fff;
    border-radius: 8px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: bold;
    transform: scale(0.8);
}

.cart-link i {
    margin-right: 5px;
}

/* 头部搜索区域 */
.header {
    height: 80px;
    background: #fff;
}

.header .container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 20px 0;
}

.search {
    margin: 0 50px;
    flex: 1;
}

.search input {
    width: 500px;
    height: 36px;
    padding: 0 10px;
    border: 2px solid #e1251b;
}

.search-btn {
    width: 80px;
    height: 40px;
    background: #e1251b;
    color: #fff;
    border: none;
    cursor: pointer;
}

/* 主导航样式 */
.main-nav {
    height: 40px;
    background: #fff;
    border-bottom: 2px solid #c81623;
}

.main-nav .container {
    position: relative;
    height: 100%;
}

/* 导航项目列表样式 */
.nav-items {
    display: flex;
    height: 100%;
}

.nav-items li {
    height: 100%;
}

/* 全部商品分类样式 */
.nav-items li.category {
    width: 190px;
    height: 40px;
    background: #c81623;
}

.nav-items li a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 20px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
}

.nav-items li:not(.category):hover a {
    background: #c81623;
}

/* 分类图标 */
.category a::before {
    content: '≡';  /* 时使用符号代替图标 */
    margin-right: 5px;
    font-size: 16px;
}

/* 页脚样式 */
.footer {
    background: #f5f5f5;
    padding: 20px 0;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: center;  /* 水平居中 */
    align-items: center;      /* 垂直居中 */
}

.copyright {
    color: #666;
    font-size: 12px;
    text-align: center;      /* 文本居中 */
    line-height: 1.5;
}

/* 添加以下样式 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* 确保最小高度为视窗高度 */
}

.main-content {
    flex: 1;  /* 主内容区域自动填充剩余空间 */
}

.footer {
    margin-top: auto;  /* 移除原来的 margin-top: 30px */
    padding: 30px 0;
    background: #f5f5f5;
}

/* 分类下拉菜 */
.category {
    position: relative;
    width: 190px;
    height: 40px;
}

/* 分类标题 */
.category > a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 40px;
    padding: 0 15px;
    background: #c81623;
    color: #fff;
    text-decoration: none;
}

/* 分类容器 */
.category-container {
    position: absolute;
    top: 40px;
    left: 0;
    width: 190px;
    background: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
}

/* 显示分类容器 */
.category:hover .category-container,
.category-container:hover {
    display: block;
}

/* 一级分类项目 */
.category-menu > li {
    height: 40px;
    line-height: 40px;
    padding: 0 15px;
    position: relative;
    cursor: pointer;
    color: #333;
    font-size: 14px;
}

.category-menu > li:hover {
    background: #f7f7f7;
    color: #e1251b;
}

/* 一级分类文字样式 */
.category-menu > li > span {
    display: block;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

/* 一级分类箭头样式 */
.category-menu > li::after {
    content: '>';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-family: simsun;
    font-size: 12px;
}

/* 一级分类悬停效果 */
.category-menu > li:hover > span {
    color: #e1251b;
}

/* 二级分类容器 */
.sub-categories {
    position: absolute;
    left: 190px;
    top: 0;
    width: 700px;
    min-height: 100%;
    background: #fff;
    padding: 20px;
    display: none;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* 显示二级分类 */
.category-menu > li:hover .sub-categories {
    display: block;
}

/* 箭头指示器 */
.category-menu > li::after {
    content: '>';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-family: simsun;
}

/* 修改 logo 相关样式 */
.logo {
    width: 190px;
    height: 40px;
}

.logo a {
    display: block;
    width: 100%;
    height: 100%;
    background: #c81623;  /* 红色背景 */
    color: #fff;  /* 白色文字 */
    text-align: center;
    line-height: 40px;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.logo a:hover {
    color: #fff;
    opacity: 0.9;
}

/* 修改二级和三级分类的样式 */
.sub-categories {
    position: absolute;
    left: 190px;
    top: 0;
    width: 400px;
    min-height: 100%;
    background: #fff;
    padding: 20px;
    display: none;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* 二级分类组样式 */
.sub-category-group {
    margin-bottom: 20px;
}

/* 二级分类标题 */
.sub-category-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e8e8e8;
}

/* 三级分类列表容器 */
.sub-category-list {
    display: flex;
    flex-wrap: wrap;
    padding: 5px 0;
}

/* 三级分类项目 */
.sub-category-item {
    width: 25%;
    padding: 4px 0;
}

.sub-category-item a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
}

.sub-category-item a:hover {
    color: #e1251b;
    text-decoration: none;
}

/* 移除所有可能继承的背景色 */
.sub-category-list,
.sub-category-item,
.sub-category-item a {
    background: none;
}

/* 使用更高优先级的选择器来确保样式生效 */
.category-menu > li .sub-categories {
    position: absolute;
    left: 190px;
    top: 0;
    width: 700px;
    min-height: 100%;
    background: #fff !important;  /* 强制使用白色背景 */
    padding: 20px;
    display: none;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* 三级分类相关样式 */
.category-menu > li .sub-category-item a {
    color: #666 !important;
    font-size: 13px;
    background: none !important;  /* 强制移除背景色 */
}

.category-menu > li .sub-category-item a:hover {
    color: #e1251b !important;
    background: none !important;  /* 确保悬停时也没有背景色 */
}

/* 移除所有相关元素的背景色 */
.category-menu > li .sub-category-list,
.category-menu > li .sub-category-item,
.category-menu > li .sub-category-group {
    background: none !important;
}

/* 确保链接没有任何装饰 */
.category-menu > li .sub-category-item a {
    text-decoration: none !important;
    padding: 2px 8px;
    display: inline-block;
}

/* 主内容区样式 */
.content-wrapper {
    display: flex;
    margin-top: 10px;
    gap: 10px;
}

/* 轮播图容器 */
.banner-container {
    flex: 1;
    height: 470px;
    position: relative;
    overflow: hidden;
}

.banner-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-list {
    width: 100%;
    height: 100%;
    position: relative;
}

.banner-list .banner-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;  /* 初始状态设为透明 */
    transition: opacity 0.5s ease-in-out;  /* 添加过渡效果 */
    display: block !important;  /* 取消 display:none，改用透明度制显示 */
    z-index: 1;  /* 默认层 */
}

.banner-list .banner-item.active {
    opacity: 1;  /* 活动状态显示 */
    z-index: 2;  /* 活动项层级更高 */
}

.banner-list img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 轮播图控制点 */
.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;  /* 添加过渡效果 */
}

.banner-dots .dot.active {
    background: #fff;
    transform: scale(1.2);  /* 活动状态稍微放大 */
}

/* 轮播图箭头 */
.banner-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.banner-arrows span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    opacity: 0;
}

.banner-arrows .arrow-left {
    left: 0;
}

.banner-arrows .arrow-right {
    right: 0;
}

.banner-container:hover .banner-arrows span {
    opacity: 1;
}

/* 右侧用户信息容器 */
.user-info-container {
    width: 290px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 用户信息区域 */
.user-profile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.welcome {
    color: #666;
    margin-bottom: 10px;
}

.login-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.login-btns a {
    padding: 5px 15px;
    border-radius: 15px;
    text-decoration: none;
}

.btn-login {
    background: #e1251b;
    color: #fff;
}

.btn-register {
    background: #fff;
    color: #e1251b;
    border: 1px solid #e1251b;
}

/* 收藏关注区域 */
.user-collect {
    display: flex;
    padding: 15px 0;
    text-align: center;
}

.collect-item {
    flex: 1;
    border-right: 1px solid #eee;
}

.collect-item:last-child {
    border-right: none;
}

.collect-item .num {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.collect-item .text {
    font-size: 12px;
    color: #999;
}

/* 商品区域样式 */
.product-section {
    margin-top: 20px;
    padding: 20px 0;
    background: #fff;
}

.section-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.section-title h2 {
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

/* 商品列表样式 */
.product-list {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;  /* 抵消商品项的外边距 */
}

/* 商品项样式 */
.product-item {
    width: calc(20% - 20px);  /* 每行5个商品 */
    margin: 10px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
    cursor: pointer;  /* 添加鼠标手型 */
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 商品图片容器 */
.product-img {
    position: relative;
    padding-bottom: 100%;  /* 1:1 比例 */
    overflow: hidden;
}

.product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品信息样式 */
.product-info {
    padding-top: 10px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    height: 40px;
    line-height: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #e1251b;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-price .symbol {
    font-size: 14px;
}

.original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.product-shop {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-sales {
    color: #999;
}

/* 轮播图样式 */
.main-banner {
    background-color: #fff;
    padding: 10px 0;
}

.main-banner .container {
    display: flex;
    gap: 10px;
}

/* 左侧分类菜单 */
.category-wrapper {
    width: 190px;
    background: #fff;
}

/* 中间轮播图 */
.banner {
    width: 690px;
    height: 470px;
    position: relative;
}

/* 右侧用户信息区域 */
.user-info {
    width: 250px;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}

/* 轮播图相关样式 */
.banner-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.slider-wrapper {
    display: flex;
    width: 400%;
    height: 100%;
    transition: transform 0.5s ease;
}

.slider-item {
    width: 25%;
    height: 100%;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户信息区域样式 */
.user-header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-welcome {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.user-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-login,
.btn-register {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

.btn-login {
    background: #e1251b;
    color: #fff;
    border: none;
}

.btn-register {
    background: #fff;
    color: #e1251b;
    border: 1px solid #e1251b;
}

/* 公告区域 */
.notice {
    padding: 15px 0;
}

.notice-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.notice-list {
    font-size: 12px;
    color: #666;
}

.notice-item {
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-item a {
    color: #666;
    text-decoration: none;
}

.notice-item a:hover {
    color: #e1251b;
}

/* 二级菜单样式 */
.sub-menu {
    display: none;
    position: absolute;
    left: 190px;  /* 与一级菜单同宽 */
    top: 0;
    width: 400px;  /* 从原来的宽度改为400px */
    min-height: 470px;  /* 与一级菜单同高 */
    background: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    padding: 10px 20px;
    box-sizing: border-box;
    z-index: 100;
}

.sub-menu-item {
    margin-bottom: 15px;
}

.sub-menu-title {
    font-size: 12px;
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
}

.sub-menu-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sub-menu-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

.sub-menu-link:hover {
    color: #e1251b;
} 